
<!DOCTYPE html>

<html lang="en">
<head >
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<title>成大方圆医药网-余额查看</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link href="http://image1.ecdfy.com/uploadFile/685/css/685_20141023112700.css" rel="stylesheet" type="text/css">

<link href="http://image1.ecdfy.com/uploadFile/715/css/715_20141104060031.css" rel="stylesheet" type="text/css">
<link href="css/common.css" rel="stylesheet" type="text/css">


<script type="text/javascript" src="http://image1.ecdfy.com/uploadFile/685/js/685_20141023112741.js" charset="utf-8"></script>

<script type="text/javascript" src="http://image1.ecdfy.com/uploadFile/685/js/685_20141023112803.js" charset="utf-8"></script>

<script type="text/javascript" src="http://image1.ecdfy.com/uploadFile/685/js/685_20141023011404.js" charset="utf-8"></script>

<script type="text/javascript" src="http://image1.ecdfy.com/uploadFile/685/js/685_20141027112059.js" charset="utf-8"></script>

<script type="text/javascript" src="http://zhao.ecdfy.com/uploadFile/685/js/685_20141027112113.js" charset="utf-8"></script>

<link href="http://image1.ecdfy.com/mobile/iscroll/iscroll.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="dist/dropload.css">

<style>
html,body{  font-family:"MicroSoft YaHei","宋体","SimHei","lucida grande",tahoma,verdana,arial,sans-serif;}

</style>
</head>
<body>
<a name="top"></a>
<!--版头 Start-->
<div id="header" class="sub3 clearfix">





<base target="_self">
<script type="text/javascript">
function setHeader(options){
	var defaults={"title":""};
	options=$.extend(defaults,options);
	var c=options.style;
	var title=options.title;
	var $header=$("#header");
	$header.addClass(c);
	if(title.length>1){
		$header.find(".title").text(title);
	};
	
loginHandler();
};
$(function(){
	pageInit();
});
searchConfigure("headerSearchWrap");
</script>

<div>

	<a href="http://m.ecdfy.com" class="col-xs-2 header-left">
		&lt;首页
	</a>
	<div class="col-xs-8" id="headerSearchWrap">
		<div class="header-center title" ></div>
		<div class="header-center sousuo" >
			<form class="form-search input-group">
				<input type="text" class="form-control keyWord" defaultValue="输入商品名称" required>
				<span class="input-group-btn">
					<button type="button"  class="btn btn-default searchSubmitBtn"></button>
				</span>
			</form>
		</div>
	</div>
	<a href="#" class="col-xs-2 shoppingDiv">
		<div class="header-right shoppingcart">
			<span class="number"></span>
		</div>
	</a>
	<a href="#" class="col-xs-2 menuDiv">	
		<div class="header-right menu">
		</div>
	</a>
</div>

</div>
<!--版头 End-->
<div id="container" class="container myAccount">
	<div class="title"><span class="icon1"></span>用户昵称：15502440636</div>
	<div class="title"><span class="icon2"></span>账户余额：<span class="red">1000</span></div>
</div>

<!--帐户余额 内容区域 Start-->
<div  class="container integralSwitch">	
	 <div class="queryBg">	
     <div class="form-group timeChange">	
						<input class="form-control" size="16" name="beginTime" id="beginTime" type="text" placeholder = "开始时间"  value="" readonly>
		
     </div>
     <div class="form-group timeChange">
            <input class="form-control" size="16" type="text" name="endTime"  id="endTime" placeholder = "结束时间"  value="" readonly>
	        		
     </div>            
           	<div class="btnCx"><input class="btn queryBtn" type="submit" value="查询明细" id="cxBtn" style="font-size:17px"/></div>
	</div>
	<!--线上线下积分转换查询 End-->
	<div id="jifenDiv" style="display:none;">
		<!--线上线下积分转换 记录显示区域 Start-->
		<h3 >交易明细</h3>
		<ul class="jfzh_content"  id="jifenJL">

		</ul>
		<!--线上线下积分转换 记录显示区域 End-->	
		<div id="pageTxt">
		   <span id="pageTxt-currentPage"></span><span>/</span><span id="pageTxt-pageCount"></span>
		   <span class="up-ioc" id="to-top"></span>
		</div>

	</div>
</div>
<!--帐户余额 内容区域 End-->
<div id="scroller-pullUp">
	     <span id="pullUpText" class="pullUpIcon"></span>
</div>
<div id="datePlugin"></div>
<script type="text/javascript" src="js/date.js" charset="utf-8"></script>
<script type="text/javascript" src="js/iscroll.js" charset="utf-8"></script>
<script type="text/javascript"src="dist/dropload.js"></script>
<script>
  $(function(){
	   $('#beginTime').date();
	   $('#endTime').date();
  });
</script>

<script>

  var jiFenUrl="data/balance.json";
	var currentPage=0;
	var pageCount=1;
	var $pageTxt_currentPage=$("#pageTxt-currentPage");
	var $pageTxt_pageCount=$("#pageTxt-pageCount");
	var beginTime,endTime,flag;
	var $pullUp = $("#scroller-pullUp"),$pullUpText = $("#pullUpText");
	var appendLoad=0;
	var windowsTop=0;

    function show(){  
	        var top = $pullUp.offset().top; 
            var p=currentPage+1;
	            if(p<=pageCount){

	                 var winTop=$(window).scrollTop();
	                 var winHeight=$(window).height() ;
	                 var tatol=winTop + winHeight ;
	                if(winTop>windowsTop){
		                  if(tatol > top ){  
		         	           $pullUp.show();
		         	           $pullUpText.html("正在努力加载..."); 
		         	          if(appendLoad==0){
							      appendLoad=1;
							      appendPage(p,1);
							   }  
		                } 
	                } 
	                windowsTop=winTop;
	             }else{
	                   $pullUp.show();
					   $pullUpText.html("无更多数据");
	             }
        
     }  
	function uppageText(){
		  $pageTxt_currentPage.html(currentPage);
		  $pageTxt_pageCount.html(pageCount);
	}
    $("#to-top").on("click",function(){
		  $("html,body").animate({scrollTop:0},200);	
    });
    function appendPage(p,tp){

         var ajaxData={"beginTime":beginTime,"endTime":endTime,"page":p};
		 $.ajax({
			url:jiFenUrl,
			dataType:"jsonp",
			crossDomain:true,
			data:ajaxData,
			"jsonpCallback":"goodsCallback",
			"success":function(data){
				pageCount=data.totalPage;
				var tgoods=data.list;
				var goodsHtml="";
				$.each(tgoods, function(index, s) {  

				 goodsHtml+= '<li class="jfzhList" style="font-size: 17px;" >'+
					'<p class="jfzhTxt">日期:<span class="txtWord">'+s.credate+'</span></p>'+
					'<p class="jfzhTxt">原单id:<span class="txtWord">'+s.sourceid+'</span></p>'+
	 				'<p class="jfzhTxt">增加金额:<span class="txtWord">'+s.addmoney+'</span></p>'+
		  			'<p class="jfzhTxt">减少金额:<span class="txtWord">'+s.delmoney+'</span></p>'+
					'<p class="jfzhTxt">余额:<span class="txtWord">'+s.balance+'</span></p>'+
					'<p class="jfzhTxt">交易类型:<span class="txtWord">'+s.sourceName+'</span></p>';
					if(s.pointName != undefined && s.pointName!=null){
					 goodsHtml += '<p class="jfzhTxt">服务站:<span class="txtWord">'+s.pointName+'</span></p>';
					}
					if(s.memo!=undefined && s.memo!=null){
					 goodsHtml+='<p class="jfzhTxt">备注:<span class="txtWord">'+s.memo+'</span></p>'
					}
				    goodsHtml+= ' </li>';
                });
                if(tp==0){
                  $("html,body").animate({scrollTop:100},1);	
                      $("#jifenDiv").show();
                      if(goodsHtml==""){
                       goodsHtml='<li class="jfzhList">'+
                       	            '<p class="jfzhTxt"><span class="txtWord">该时间段您没有消费记录！</span></p>'+
                                 '</li>';
                      }
                     currentPage=1;
                     $("#jifenJL").html(goodsHtml);
                }else{
                	currentPage++;
                      $("#jifenJL").append(goodsHtml);
                }
                 $pullUp.hide();
				 $pullUpText.html("");
				 setTimeout(function(){
				 		 appendLoad=0;
				 		 uppageText();
				 },100);     
			},error:function(){
			    appendLoad=0;
			}
		});   
	
    } 
    	$("#cxBtn").on("click",function(){
	  	 beginTime=$("#beginTime").val();
	  	 endTime=$("#endTime").val();
	  	 if(beginTime==""||endTime==""||beginTime=="开始时间"||endTime=="结束时间"){
	  	    alert("请选择时间区间");
	  	 }else{
	  	    appendPage(1,0);
	  	 }
	  	 
	});
    
    
    $(function(){


    // dropload
    $('.jfzh_content').dropload({
        scrollArea : window,
        loadDownFn : function(me){
           console.log(1);
        }
    });
});
</script>

	
<script>
function pageInit(){
	setHeader({"style":"sub3","title":"查询积分明细"});
}
</script>


</body>
</html>